package com.dem.javatestwebsocket.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
@Data
@NoArgsConstructor
public class PageVo<T> {
    private long pageNumber;
    private long pageSize;
    private long totalCount;
    private long totalPage;
    private List<T>records;

    public PageVo(IPage< T> pageResult) {
        this.pageNumber = pageResult.getCurrent();
        this.pageSize = pageResult.getSize();
        this.totalPage = pageResult.getPages();
        this.totalCount = pageResult.getTotal();
        this.records = pageResult.getRecords();
    }
}
